1. Field of the Invention
The present invention relates to a magnetic sensor and a method of measuring magnetic field strength.
2. Related Background Art
Magnetic sensors which employ a magneto-resistive effect element such as a GMR (Giant Magneto-Resistive) element are known. These magnetic sensors utilize a phenomenon whereby the resistance value of the magneto-resistive effect element depends on the relative angle between the magnetization orientations of a magnetization-free layer and a magnetization fixed layer respectively in the magneto-resistive effect element. More specifically, while a fixed sensing current is flowing in the magneto-resistive effect element, an external magnetic field which is to be measured is applied to the magnetization-free layer in the magnetic sensor in order to change the magnetization direction thereof and measurement of the external magnetic field is performed by measuring the resistance value of the magneto-resistive effect element.
In cases where an external magnetic field is applied to the magnetization-free layer, hysteresis exists for the relationship between the degree of magnetization and the external magnetic field. Hence, hysteresis also exists for the relationship between the resistance value of the magneto-resistive effective element and the external magnetic field. That is, even when an external magnetic field of the same strength is applied, the resistance value and the gain of the magneto-resistive effect element (the gradient of the resistance value/external magnetic field strength cure of the magneto-resistive effect element) sometimes changes depending on the strength of another external magnetic field applied to the magnetization-free layer just before the external magnetic field is applied. When this arises, an error is generated when the external magnetic field is measured using the magnetic sensor.
In order to prevent such a problem, a method for applying a magnetic field to the magnetization-free layer to saturate the magnetization either before measuring the external magnetic field, at regular intervals, or every time a fixed number of measurements have been carried out is known. When this application of a magnetic field is stopped after saturating the magnetization in this manner, the magnetized state of the magnetization-free layer is fixed irrespective of the state before the magnetization is saturated (referred to hereinbelow as the ‘initialization of the magnetization-free layer’).
Initialization of this kind is performed by providing a solenoid coil or a spiral-shaped coil, for example, close to the magneto-resistive effect element. More specifically, the solenoid coil or spiral-shaped coil is placed close to the magneto-resistive effect element in the longitudinal direction of the magneto-resistive effect element and the magnetic fields generated by these coils are applied in the longitudinal direction of the magneto-resistive effect element (See Japanese Patent Document Nos. 3835447 and 3835354, and Japanese Patent Application Laid Open Nos. 2006-267120 and 2005-515667.